package com.tony.blog.model.mapper;

import com.tony.blog.model.entity.CommentEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: CommentMapper
 * @Auther: 皮蛋布丁
 * @Date: 2021/08/16/20:46
 * @Description: 评论表
 */
public interface CommentMapper {

    /**
    * @Description: countByBlogId 根据博文id获取评论数量
    * @Param: [blogId]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/8/16 20:47
    */
    Integer countByBlogId(@Param("blogId") Integer blogId);

    /**
    * @Description: insertSelective 评论
    * @Param: [comment]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/9/5 20:55
    */
    Integer insertSelective(CommentEntity comment);

    /**
    * @Description: selectByPrimaryKey 获取评论信息
    * @Param: [id]
    * @return: com.tony.blog.model.entity.CommentEntity
    * @Author: 皮蛋布丁
    * @Date: 2021/9/10 11:16
    */
    CommentEntity selectByPrimaryKey(Integer id);

    /**
    * @Description: selectByBlogId 根据博文id获取回复列表
    * @Param: [blogId]
    * @return: java.util.List<com.tony.blog.model.entity.CommentEntity>
    * @Author: 皮蛋布丁
    * @Date: 2021/9/10 13:15
    */
    List<CommentEntity> selectByBlogId(@Param("blogId") Integer blogId);
}
